<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">

<html><head><title>smuoi.php</title><link rel="stylesheet" type="text/css" href="../styles/main.css"><script language=JavaScript src="../javascript/main.js"></script><script language=JavaScript src="../javascript/searchdata.js"></script></head><body class="ContentPage" onLoad="NDOnLoad()"><script language=JavaScript><!--
if (browserType) {document.write("<div class=" + browserType + ">");if (browserVer) {document.write("<div class=" + browserVer + ">"); }}// --></script>

<!--  Generated by Natural Docs, version Development Release 12-07-2007 (1.35 base) -->
<!--  http://www.naturaldocs.org  -->

<!-- saved from url=(0026)http://www.naturaldocs.org -->




<div id=Content><div class="CFile"><div class=CTopic id=MainTopic><h1 class=CTitle><a name="smuoi.php"></a>smuoi.php</h1><div class=CBody><p>The invocation script.&nbsp; &copy; Clancy Hood 2010.</p><!--START_ND_SUMMARY--><div class=Summary><div class=STitle>Summary</div><div class=SBorder><table border=0 cellspacing=0 cellpadding=0 class=STable><tr class="SMain"><td class=SEntry><a href="#smuoi.php" >smuoi.php</a></td><td class=SDescription>The invocation script. </td></tr><tr class="SGroup"><td class=SEntry><a href="#Functions" >Functions</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#smuoi_getenv" id=link1 onMouseOver="ShowTip(event, 'tt1', 'link1')" onMouseOut="HideTip('tt1')">smuoi_getenv</a></td><td class=SDescription>The remaining function for reading environment variables, including constants which can be used to set global defaults. </td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#utime" id=link2 onMouseOver="ShowTip(event, 'tt2', 'link2')" onMouseOut="HideTip('tt2')">utime</a></td><td class=SDescription>Returns <b>string</b> UNIX time to 6 decimal places (microseconds).</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#smuoi_explode" id=link3 onMouseOver="ShowTip(event, 'tt3', 'link3')" onMouseOut="HideTip('tt3')">smuoi_explode</a></td><td class=SDescription>Explodes, but removes any empty members.</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#smuoi_unexplode" id=link4 onMouseOver="ShowTip(event, 'tt4', 'link4')" onMouseOut="HideTip('tt4')">smuoi_unexplode</a></td><td class=SDescription>Cleans path strings by exploding and imploding again. </td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#smuoi_clean_request_uri" id=link5 onMouseOver="ShowTip(event, 'tt5', 'link5')" onMouseOut="HideTip('tt5')">smuoi_clean_request_uri</a></td><td class=SDescription><a href="#smuoi_unexplode" class=LFunction id=link6 onMouseOver="ShowTip(event, 'tt4', 'link6')" onMouseOut="HideTip('tt4')">smuoi_unexplode</a>s a request uri, strips query string if present.</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#array_pick" id=link7 onMouseOver="ShowTip(event, 'tt6', 'link7')" onMouseOut="HideTip('tt6')">array_pick</a></td><td class=SDescription>Picks value from an array by key, if present.</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#globget" id=link8 onMouseOver="ShowTip(event, 'tt7', 'link8')" onMouseOut="HideTip('tt7')">globget</a></td><td class=SDescription>Fetches global variable set with <a href="#globset" class=LFunction id=link9 onMouseOver="ShowTip(event, 'tt8', 'link9')" onMouseOut="HideTip('tt8')">globset</a>.</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#globset" id=link10 onMouseOver="ShowTip(event, 'tt8', 'link10')" onMouseOut="HideTip('tt8')">globset</a></td><td class=SDescription>Sets global variables (with prefix smuoi\).</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#smuoi_register_shutdown_function" id=link11 onMouseOver="ShowTip(event, 'tt9', 'link11')" onMouseOut="HideTip('tt9')">smuoi_register_shutdown_function</a></td><td class=SDescription>It&rsquo;s often useful to call shutdown functions in reverse order of registration. </td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#smuoi_jump_shutdown_queue" id=link12 onMouseOver="ShowTip(event, 'tt10', 'link12')" onMouseOut="HideTip('tt10')">smuoi_jump_shutdown_queue</a></td><td class=SDescription>Sometimes we need to make absoutely sure a function is called first. </td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#smuoi_call_shutdown_funcs" id=link13 onMouseOver="ShowTip(event, 'tt11', 'link13')" onMouseOut="HideTip('tt11')">smuoi_call_shutdown_funcs</a></td><td class=SDescription>Called by PHP on exit.</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#smuoi_is_exiting" id=link14 onMouseOver="ShowTip(event, 'tt12', 'link14')" onMouseOut="HideTip('tt12')">smuoi_is_exiting</a></td><td class=SDescription>Returns bool SMUOI/PHP is exiting.</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#smuoi_print_stats" id=link15 onMouseOver="ShowTip(event, 'tt13', 'link15')" onMouseOut="HideTip('tt13')">smuoi_print_stats</a></td><td class=SDescription>Prints out memory usage (rather ambiguous), time in seconds the operation took, number of database queries performed and included file count.</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#__autoload" id=link16 onMouseOver="ShowTip(event, 'tt14', 'link16')" onMouseOut="HideTip('tt14')">__autoload</a></td><td class=SDescription>PHP&rsquo;s magic class autoloader. </td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#sm_startup_error" id=link17 onMouseOver="ShowTip(event, 'tt15', 'link17')" onMouseOut="HideTip('tt15')">sm_startup_error</a></td><td class=SDescription>Quick-and-dirty error handler for errors on startup.</td></tr><tr class="SGroup"><td class=SEntry><a href="#Constants" >Constants</a></td><td class=SDescription></td></tr><tr class="SConstant SIndent1 SMarked"><td class=SEntry><a href="#Identfiers" >Identfiers</a></td><td class=SDescription></td></tr><tr class="SConstant SIndent1"><td class=SEntry><a href="#Host_paths" >Host paths</a></td><td class=SDescription></td></tr><tr class="SConstant SIndent1 SMarked"><td class=SEntry><a href="#More_host_paths" >More host paths</a></td><td class=SDescription></td></tr><tr class="SConstant SIndent1"><td class=SEntry><a href="#Context" >Context</a></td><td class=SDescription></td></tr><tr class="SConstant SIndent1 SMarked"><td class=SEntry><a href="#deprecated" >deprecated</a></td><td class=SDescription></td></tr><tr class="SConstant SIndent1"><td class=SEntry><a href="#Orientation" >Orientation</a></td><td class=SDescription></td></tr></table></div></div><!--END_ND_SUMMARY--></div></div></div>

<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="Functions"></a>Functions</h3></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="smuoi_getenv"></a>smuoi_getenv</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>function smuoi_getenv(</td><td class=PParameter nowrap>$N</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>The remaining function for reading environment variables, including constants which can be used to set global defaults.&nbsp; Unset / undefined env vars are returned as null.</p><h4 class=CHeading>params</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>N</td><td class=CDLDescription>(string) env var name</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="utime"></a>utime</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>function utime()</td></tr></table></blockquote><p>Returns <b>string</b> UNIX time to 6 decimal places (microseconds).</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="smuoi_explode"></a>smuoi_explode</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>function smuoi_explode(</td><td class=PParameter nowrap>$d,</td></tr><tr><td></td><td class=PParameter nowrap>$s</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Explodes, but removes any empty members.</p><h4 class=CHeading>params</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>d</td><td class=CDLDescription>(string) delimiter</td></tr><tr><td class=CDLEntry>s</td><td class=CDLDescription>(string) what to explode</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="smuoi_unexplode"></a>smuoi_unexplode</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>function smuoi_unexplode(</td><td class=PParameter nowrap>$s,</td><td class=PDefaultValuePrefix>&nbsp;&nbsp;</td><td class=PDefaultValue width=100%></td></tr><tr><td></td><td class=PParameter nowrap>$d</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>'/'</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Cleans path strings by exploding and imploding again.&nbsp; Accepts arguments in <b>opposite</b> order to explode functions such as <a href="#smuoi_explode" class=LFunction id=link18 onMouseOver="ShowTip(event, 'tt3', 'link18')" onMouseOut="HideTip('tt3')">smuoi_explode</a>.&nbsp; Turns input such as /path//to///file/ into path/to/file.</p><h4 class=CHeading>params</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>s</td><td class=CDLDescription>(string) what to clean</td></tr><tr><td class=CDLEntry>d</td><td class=CDLDescription>(string) delimiter</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="smuoi_clean_request_uri"></a>smuoi_clean_request_uri</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>function smuoi_clean_request_uri(</td><td class=PParameter nowrap>$u</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p><a href="#smuoi_unexplode" class=LFunction id=link19 onMouseOver="ShowTip(event, 'tt4', 'link19')" onMouseOut="HideTip('tt4')">smuoi_unexplode</a>s a request uri, strips query string if present.</p><h4 class=CHeading>params</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>u</td><td class=CDLDescription>(string) uri to clean</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="array_pick"></a>array_pick</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>function array_pick(</td><td class=PType nowrap>&nbsp;</td><td class=PParameter nowrap>$k,</td></tr><tr><td></td><td class=PType nowrap>array&nbsp;</td><td class=PParameter nowrap>$a</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Picks value from an array by key, if present.</p><h4 class=CHeading>params</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>k</td><td class=CDLDescription>(string) key</td></tr><tr><td class=CDLEntry>a</td><td class=CDLDescription>(array) array</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="globget"></a>globget</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>function globget(</td><td class=PParameter nowrap>$k</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Fetches global variable set with <a href="#globset" class=LFunction id=link20 onMouseOver="ShowTip(event, 'tt8', 'link20')" onMouseOut="HideTip('tt8')">globset</a>.</p><h4 class=CHeading>params</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>k</td><td class=CDLDescription>(string) key</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="globset"></a>globset</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>function globset(</td><td class=PParameter nowrap>$k,</td></tr><tr><td></td><td class=PParameter nowrap>$v</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Sets global variables (with prefix smuoi\).</p><h4 class=CHeading>params</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>k</td><td class=CDLDescription>(string) key</td></tr><tr><td class=CDLEntry>v</td><td class=CDLDescription>(mixed) var</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="smuoi_register_shutdown_function"></a>smuoi_register_shutdown_function</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>function smuoi_register_shutdown_function(</td><td class=PParameter nowrap>$f</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>It&rsquo;s often useful to call shutdown functions in reverse order of registration.&nbsp; For this we use own array and krsort it on shutdown.</p><h4 class=CHeading>params</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>f</td><td class=CDLDescription>valid callback</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="smuoi_jump_shutdown_queue"></a>smuoi_jump_shutdown_queue</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>function smuoi_jump_shutdown_queue(</td><td class=PParameter nowrap>$f</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Sometimes we need to make absoutely sure a function is called first.&nbsp; This system predates the simpler method of registering and firing events.</p><h4 class=CHeading>params</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>f</td><td class=CDLDescription>valid callback</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="smuoi_call_shutdown_funcs"></a>smuoi_call_shutdown_funcs</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>function smuoi_call_shutdown_funcs()</td></tr></table></blockquote><p>Called by PHP on exit.</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="smuoi_is_exiting"></a>smuoi_is_exiting</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>function smuoi_is_exiting()</td></tr></table></blockquote><p>Returns bool SMUOI/PHP is exiting.</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="smuoi_print_stats"></a>smuoi_print_stats</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>function smuoi_print_stats()</td></tr></table></blockquote><p>Prints out memory usage (rather ambiguous), time in seconds the operation took, number of database queries performed and included file count.</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="__autoload"></a>__autoload</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>function __autoload(</td><td class=PParameter nowrap>$class</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>PHP&rsquo;s magic class autoloader.&nbsp;  Looks in <a href="#SMERNEL_PATH" class=LConstant id=link21 onMouseOver="ShowTip(event, 'tt16', 'link21')" onMouseOut="HideTip('tt16')">SMERNEL_PATH</a> for $class.php.</p><h4 class=CHeading>params</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>class</td><td class=CDLDescription>classname to load</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="sm_startup_error"></a>sm_startup_error</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>function sm_startup_error(</td><td class=PParameter nowrap>$n,</td></tr><tr><td></td><td class=PParameter nowrap>$str,</td></tr><tr><td></td><td class=PParameter nowrap>$file,</td></tr><tr><td></td><td class=PParameter nowrap>$line</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Quick-and-dirty error handler for errors on startup.</p></div></div></div>

<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="Constants"></a>Constants</h3></div></div>

<div class="CConstant"><div class=CTopic><h3 class=CTitle><a name="Identfiers"></a>Identfiers</h3><div class=CBody><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry><a name="SMUOI_TIME_IN"></a>SMUOI_TIME_IN</td><td class=CDLDescription>Our earliest opportunity to hit the stopwatch.</td></tr><tr><td class=CDLEntry><a name="INSTANCE"></a>INSTANCE</td><td class=CDLDescription>Our unique instance id (typically a 40-char alphanumeric string with two periods).</td></tr><tr><td class=CDLEntry><a name="ARF"></a>ARF</td><td class=CDLDescription>Apache Requested Filename.&nbsp; $_SERVER[&lsquo;REQUEST_URI&rsquo;] stripped of query string.</td></tr><tr><td class=CDLEntry><a name="XTN"></a>XTN</td><td class=CDLDescription>Extension of file that called this script.</td></tr></table></div></div></div>

<div class="CConstant"><div class=CTopic><h3 class=CTitle><a name="Host_paths"></a>Host paths</h3><div class=CBody><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry><a name="SMUOI_DIR"></a>SMUOI_DIR</td><td class=CDLDescription>Directory that smuoi.php resides in</td></tr><tr><td class=CDLEntry><a name="PKG_DIR"></a>PKG_DIR</td><td class=CDLDescription>Shorthand for <a href="#SMUOI_DIR" class=LConstant id=link22 onMouseOver="ShowTip(event, 'tt17', 'link22')" onMouseOut="HideTip('tt17')">SMUOI_DIR</a>/Applications</td></tr><tr><td class=CDLEntry><a name="SMR_DIR"></a>SMR_DIR</td><td class=CDLDescription>Shorthand for <a href="#SMUOI_DIR" class=LConstant id=link23 onMouseOver="ShowTip(event, 'tt17', 'link23')" onMouseOut="HideTip('tt17')">SMUOI_DIR</a>/Smernel</td></tr></table></div></div></div>

<div class="CConstant"><div class=CTopic><h3 class=CTitle><a name="More_host_paths"></a>More host paths</h3><div class=CBody><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry><a name="ETC_DIR"></a>ETC_DIR</td><td class=CDLDescription>Shorthand for <a href="smrc-php.html#SMUOI_PREFIX" class=LConstant id=link24 onMouseOver="ShowTip(event, 'tt18', 'link24')" onMouseOut="HideTip('tt18')">SMUOI_PREFIX</a>/etc</td></tr><tr><td class=CDLEntry><a name="LOG_DIR"></a>LOG_DIR</td><td class=CDLDescription>Shorthand for <a href="smrc-php.html#SMUOI_PREFIX" class=LConstant id=link25 onMouseOver="ShowTip(event, 'tt18', 'link25')" onMouseOut="HideTip('tt18')">SMUOI_PREFIX</a>/cruft/log</td></tr><tr><td class=CDLEntry><a name="LOCAL_DIR"></a>LOCAL_DIR</td><td class=CDLDescription>Shorthand for <a href="smrc-php.html#SMUOI_PREFIX" class=LConstant id=link26 onMouseOver="ShowTip(event, 'tt18', 'link26')" onMouseOut="HideTip('tt18')">SMUOI_PREFIX</a>/cruft/local</td></tr><tr><td class=CDLEntry><a name="TMP_DIR"></a>TMP_DIR</td><td class=CDLDescription>Shorthand for <a href="smrc-php.html#SMUOI_PREFIX" class=LConstant id=link27 onMouseOver="ShowTip(event, 'tt18', 'link27')" onMouseOut="HideTip('tt18')">SMUOI_PREFIX</a>/cruft/tmp</td></tr></table></div></div></div>

<div class="CConstant"><div class=CTopic><h3 class=CTitle><a name="Context"></a>Context</h3><div class=CBody><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry><a name="PUBLIC_DOMAIN"></a>PUBLIC_DOMAIN</td><td class=CDLDescription>Bool whether we are in a public or private (desktop) context</td></tr><tr><td class=CDLEntry><a name="CONTEXT"></a>CONTEXT</td><td class=CDLDescription>3-char (dom|dsk) representation of the above</td></tr></table></div></div></div>

<div class="CConstant"><div class=CTopic><h3 class=CTitle><a name="deprecated"></a>deprecated</h3><div class=CBody><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry><a name="SHR"></a>SHR</td><td class=CDLDescription>Path below desktop domain to public files (no authentication)</td></tr><tr><td class=CDLEntry><a name="SHR_ROOT"></a>SHR_ROOT</td><td class=CDLDescription>Path on host to the above</td></tr></table></div></div></div>

<div class="CConstant"><div class=CTopic><h3 class=CTitle><a name="Orientation"></a>Orientation</h3><div class=CBody><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry><a name="SERVER_NAME"></a>SERVER_NAME</td><td class=CDLDescription>$_SERVER[&lsquo;SERVER_NAME&rsquo;]</td></tr><tr><td class=CDLEntry><a name="DOM_ID"></a>DOM_ID</td><td class=CDLDescription>ID of domain</td></tr><tr><td class=CDLEntry><a name="SMERNEL"></a>SMERNEL</td><td class=CDLDescription>Smernel version to use</td></tr><tr><td class=CDLEntry><a name="SMERNEL_PATH"></a>SMERNEL_PATH</td><td class=CDLDescription>Shorthand for SMR_DIR/<a href="#SMERNEL" class=LConstant id=link28 onMouseOver="ShowTip(event, 'tt19', 'link28')" onMouseOut="HideTip('tt19')">SMERNEL</a></td></tr></table></div></div></div>

</div><!--Content-->


<div id=Footer><a href="http://www.naturaldocs.org">Generated by Natural Docs</a></div><!--Footer-->


<div id=Menu><div class=MEntry><div class=MFile><a href="cgi-workaround-php.html">cgi-workaround.php</a></div></div><div class=MEntry><div class=MFile><a href="cruft/README-txt.html">Cruft Directory README</a></div></div><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent1')">Smernel</a><div class=MGroupContent id=MGroupContent1><div class=MEntry><div class=MFile><a href="Smernel/Adeliae/Resources/@public/js/unittest-js.html">Due to a fix in Firefox 1....6 or DP2.</a></div></div><div class=MEntry><div class=MFile><a href="Smernel/Adeliae/Resources/@public/js/builder-js.html">For Firefox &lt; 1.<span class=HB> </span>5, OPTION and OPTGROUP tags are currently broken,</a></div></div></div></div></div><div class=MEntry><div class=MFile><a href="smrc-php.html">smrc.php</a></div></div><div class=MEntry><div class=MFile><a href="smuoi-prepend-php.html">smuoi-prepend.php</a></div></div><div class=MEntry><div class=MFile id=MSelected>smuoi.php</div></div><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent2')">Index</a><div class=MGroupContent id=MGroupContent2><div class=MEntry><div class=MIndex><a href="../index/General.html">Everything</a></div></div><div class=MEntry><div class=MIndex><a href="../index/Constants.html">Constants</a></div></div><div class=MEntry><div class=MIndex><a href="../index/Files.html">Files</a></div></div><div class=MEntry><div class=MIndex><a href="../index/Functions.html">Functions</a></div></div></div></div></div><script type="text/javascript"><!--
var searchPanel = new SearchPanel("searchPanel", "HTML", "../search");
--></script><div id=MSearchPanel class=MSearchPanelInactive><input type=text id=MSearchField value=Search onFocus="searchPanel.OnSearchFieldFocus(true)" onBlur="searchPanel.OnSearchFieldFocus(false)" onKeyUp="searchPanel.OnSearchFieldChange()"><select id=MSearchType onFocus="searchPanel.OnSearchTypeFocus(true)" onBlur="searchPanel.OnSearchTypeFocus(false)" onChange="searchPanel.OnSearchTypeChange()"><option  id=MSearchEverything selected value="General">Everything</option><option value="Constants">Constants</option><option value="Files">Files</option><option value="Functions">Functions</option></select></div></div><!--Menu-->



<!--START_ND_TOOLTIPS-->
<div class=CToolTip id="tt1"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>function smuoi_getenv(</td><td class=PParameter nowrap>$N</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>The remaining function for reading environment variables, including constants which can be used to set global defaults. </div></div><div class=CToolTip id="tt2"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>function utime()</td></tr></table></blockquote>Returns <b>string</b> UNIX time to 6 decimal places (microseconds).</div></div><div class=CToolTip id="tt3"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>function smuoi_explode(</td><td class=PParameter nowrap>$d,</td></tr><tr><td></td><td class=PParameter nowrap>$s</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Explodes, but removes any empty members.</div></div><div class=CToolTip id="tt4"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>function smuoi_unexplode(</td><td class=PParameter nowrap>$s,</td><td class=PDefaultValuePrefix>&nbsp;&nbsp;</td><td class=PDefaultValue width=100%></td></tr><tr><td></td><td class=PParameter nowrap>$d</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%>'/'</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Cleans path strings by exploding and imploding again. </div></div><div class=CToolTip id="tt5"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>function smuoi_clean_request_uri(</td><td class=PParameter nowrap>$u</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>smuoi_unexplodes a request uri, strips query string if present.</div></div><div class=CToolTip id="tt6"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>function array_pick(</td><td class=PType nowrap>&nbsp;</td><td class=PParameter nowrap>$k,</td></tr><tr><td></td><td class=PType nowrap>array&nbsp;</td><td class=PParameter nowrap>$a</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Picks value from an array by key, if present.</div></div><div class=CToolTip id="tt7"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>function globget(</td><td class=PParameter nowrap>$k</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Fetches global variable set with globset.</div></div><div class=CToolTip id="tt8"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>function globset(</td><td class=PParameter nowrap>$k,</td></tr><tr><td></td><td class=PParameter nowrap>$v</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Sets global variables (with prefix smuoi\).</div></div><div class=CToolTip id="tt9"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>function smuoi_register_shutdown_function(</td><td class=PParameter nowrap>$f</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>It&rsquo;s often useful to call shutdown functions in reverse order of registration. </div></div><div class=CToolTip id="tt10"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>function smuoi_jump_shutdown_queue(</td><td class=PParameter nowrap>$f</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Sometimes we need to make absoutely sure a function is called first. </div></div><div class=CToolTip id="tt11"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>function smuoi_call_shutdown_funcs()</td></tr></table></blockquote>Called by PHP on exit.</div></div><div class=CToolTip id="tt12"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>function smuoi_is_exiting()</td></tr></table></blockquote>Returns bool SMUOI/PHP is exiting.</div></div><div class=CToolTip id="tt13"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>function smuoi_print_stats()</td></tr></table></blockquote>Prints out memory usage (rather ambiguous), time in seconds the operation took, number of database queries performed and included file count.</div></div><div class=CToolTip id="tt14"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>function __autoload(</td><td class=PParameter nowrap>$class</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>PHP&rsquo;s magic class autoloader. </div></div><div class=CToolTip id="tt15"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>function sm_startup_error(</td><td class=PParameter nowrap>$n,</td></tr><tr><td></td><td class=PParameter nowrap>$str,</td></tr><tr><td></td><td class=PParameter nowrap>$file,</td></tr><tr><td></td><td class=PParameter nowrap>$line</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Quick-and-dirty error handler for errors on startup.</div></div><div class=CToolTip id="tt16"><div class=CConstant>Shorthand for SMR_DIR/SMERNEL</div></div><div class=CToolTip id="tt17"><div class=CConstant>Directory that smuoi.php resides in</div></div><div class=CToolTip id="tt18"><div class=CConstant>Root of etc, public &amp; private directories</div></div><div class=CToolTip id="tt19"><div class=CConstant>Smernel version to use</div></div><!--END_ND_TOOLTIPS-->




<div id=MSearchResultsWindow><iframe src="" frameborder=0 name=MSearchResults id=MSearchResults></iframe><a href="javascript:searchPanel.CloseResultsWindow()" id=MSearchResultsWindowClose>Close</a></div>


<script language=JavaScript><!--
if (browserType) {if (browserVer) {document.write("</div>"); }document.write("</div>");}// --></script></body></html>